<!DOCTYPE HTML>
<html  lang="zh" xmlns:th="http://www.thymeleaf.org">
<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-manager-add">
			<div class="form-group">	
				<label class="col-sm-3 control-label">显示顺序：</label>
				<div class="col-sm-8">
					<input id="menuSort" name="menuSort" class="form-control" type="text">
				</div>
			</div>
			<div class="form-group">	
				<label class="col-sm-3 control-label">菜单名称：</label>
				<div class="col-sm-8">
					<input id="menuName" name="menuName" class="form-control" type="text">
				</div>
			</div>
			<!-- <div class="form-group">	
				<label class="col-sm-3 control-label">菜单类型</label>
                <div class="col-sm-8">
				    <div class="radio-box" th:each="dict : ${@dict.getType('menu_manager_type')}">
						<input type="radio" th:id="${dict.dictCode}" name="menuType" th:value="${dict.dictValue}" th:checked="${dict.isDefault == 'Y' ? true : false}">
						<label th:for="${dict.dictCode}" th:text="${dict.dictLabel}"></label>
					</div>
				</div>
			</div> -->
			<div class="form-group">	
				<label class="col-sm-3 control-label">状态：</label>
				<div class="col-sm-8">
				    <div class="radio-box" th:each="dict : ${@dict.getType('sys_normal_disable')}">
						<input type="radio" th:id="${dict.dictCode}" name="status" th:value="${dict.dictValue}" th:checked="${dict.isDefault == 'Y' ? true : false}">
						<label th:for="${dict.dictCode}" th:text="${dict.dictLabel}"></label>
					</div>
				</div>
			</div>
			<div class="form-group">
				<div class="form-control-static col-sm-offset-9">
					<button type="submit" class="btn btn-primary">提交</button>
					<button onclick="$.modal.close()" class="btn btn-danger" type="button">关闭</button>
				</div>
			</div>
		</form>
	</div>
    <div th:include="include::footer"></div>
    <script type="text/javascript">
		var prefix = ctx + "dailymenu/menumanager"
		$("#form-manager-add").validate({
			rules:{
				menuSort:{
					required:true,
				},
				menuName:{
					required:true,
				},
				menuSort:{
					required:true,
				},
			},
			submitHandler: function(form) {
				$.operate.save(prefix + "/add", $('#form-manager-add').serialize());
			}
		});
		
		// h新建进入此页聚焦于第一输入框
		document.getElementsByName("menuSort")[0].focus()
	</script>
</body>
</html>
